#include "stdafx.h"

#include "Player/Player.h"
#include "RunningState.h"
#include "terrain/Terrain.h"
#include "core/game.h"
#include "input/InputManager.h"
#include "Obj/ObjContainer.h"
#include "player/Player.h"

RunningState::RunningState() : player(new Player()), terrain(Terrain::getInstance()), input(InputManager::getInstance())
{
    type = RUNNING;
}

RunningState::~RunningState()
{

}

void RunningState::update(float dt)
{
	input->update();
	player->draw(dt, true);   
	terrain->render(player->getViewMatrix(), false);
}

void RunningState::init()
{
	player = new Player();
	inited = true;
}

void RunningState::activate()
{
    queuedState = NULL_STATE;
	if (!inited) // init on first activation 
		init();
}

void RunningState::idle() {

}